<!--
 * @Author WangZhiGang
 * @Date 2025-06-16 19:42:41
 * @Description 
 -->
<template>
  <div>
    <button @click="count+=1">
      count is: {{ count }}
    </button>
  </div>
</template>

<script setup>
import {ref, watch} from 'vue';

const count = ref(0);

watch(count, (newVal, oldVal) => {
  console.log('old count:', oldVal)
  console.log('count changed:', newVal);
});
</script>